package com.lijian.netty.socket2.client;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * @author lj02
 * @desc
 * @date 2018/11/22
 */
public class HelloClientChannelHandlerAdapter extends SimpleChannelInboundHandler<String> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
        System.out.println(" server msg is : " + msg);

        ctx.writeAndFlush(" from client " + msg);
    }

    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
//        super.channelActive(ctx);
        ctx.writeAndFlush(" from client ");
    }
}
